<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=<!--{$CHARSET}-->" />
	<title><!--{$title}--> -<!--{$config_core.seo_title}--></title>
	<meta name="keywords" content="<!--{$config_core.head_keywords}-->" />
	<meta name="description" content="<!--{$config_core.head_description}-->" />
	<meta http-equiv="x-ua-compatible" content="ie=7" />
	<meta name="generator" content="CityBao System" />
	<meta name="author" content="www.citybao.net" />
	<link href="<!--{$INSTALL_PATH}-->favicon.ico" rel="shortcut icon" />
	<link href="<!--{$INSTALL_PATH}-->favicon.ico" rel="bookmark" />
	<link href="<!--{$CSS_DIR}-->citybao.css" rel="stylesheet" type="text/css" />
	<link href="<!--{$CSS_DIR}-->member.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" language="javascript">
		var CB_CssPath = '<!--{$CSS_DIR}-->';
		var CB_ImgPath = '<!--{$IMG_DIR}-->';
		var CB_JsPath  = '<!--{$JS_DIR}-->';
		<!--{if $SAFE_DOMAIN != ''}-->
		document.domain = '<!--{$SAFE_DOMAIN}-->';
		<!--{/if}-->
	</script>
	<script type="text/javascript" src="<!--{$JS_DIR}-->jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="<!--{$JS_DIR}-->common.js"></script>
	<script type="text/javascript" src="<!--{$JS_DIR}-->member-menu.js"></script>
	<script type="text/javascript" src="<!--{$JS_DIR}-->Dialog.js"></script>
	<script type="text/javascript">
		$(function() {
			//输入框样式
			$('input:visible')
				.focus(function(){
					node = $(this).parents('span.input')
					node.removeClass('inputRed');
					node.addClass('inputGreen');
					showError($(this),'clear');
				}).blur(function(){
					node = $(this).parents('span.input')
					node.removeClass('inputGreen');
					if($(this).attr('name') == 'email'){
						msg = checkEmail($(this).val());
						if(msg == 'hide')
							checkEmailExist($(this));
						showError($(this),msg);
					}
				});
				//表单提交验证
			$("#changemail").submit(function(){
				var ajax = true;//是否启用Ajax
				var flag=true;
				$('input:visible').each(function(){
					if($(this).val() == ''){
						Dialog("提示","text:请完善表单后再提交!","400","150",true,"",true);
						flag = false;
						return false;
					}
				});
				if(flag&&ajax){
					$.ajax({
						url:window.location.herf,
						type: "POST",
						data:$("#changemail").serialize(),
						success:function(responseText){
							if(responseText.search("OK")>=0){
								Dialog("提示","text:邮箱修改成功！","400","150",true,"",true);
							}else{
								Dialog("提示","text:邮箱修改失败！<br />原因："+responseText,"400","150",true,"",true);
							}
						}
					});
					return false;
				}else{
					return flag;
				}
			});
		});
		
		/**
		 * 检验邮箱地址的可用性
		 */
		function checkEmailExist(e){
			var email = e.val();
			$.ajax({
				url:'<!--{$INSTALL_PATH}-->ajax.php',
				type: "POST",
				data:'action=email-exist&email='+email,
				success:function(responseText){
					if(responseText.search("no")>=0){
						msg = 'hide';
					}else if(responseText.search("yes")>=0){
						msg = '邮箱地址已被占用，请更换！';
					}else{
						msg = '异步通信错误';
					}
					showError(e,msg);
				}
			});
		}
	</script>
</head>
<body>
<!--{include file='header.tpl'}-->
<!--{assign var='guide_suffix' value='修改邮箱'}-->
<!--{include file='guide.tpl'}-->
<div id="container" class="clearfix">
<!--{include file='member/member-menu.tpl'}-->
	<div class="member-main" id="member-main" style="padding-top:50px;">
		<div class="fillet filletColor7">
			<b class="fillet1"></b><b class="fillet2"></b><b class="fillet3"></b><b class="fillet4"></b>
			<div class="filletContent padding10">
				<div class="fRed tCenter" id="error"><!--{$error}--></div>
				<form action="" method="post" name="changemail" id="changemail">
					<input type="hidden" name="forward" value="<!--{$forward}-->" id='forward' />
					<input type="hidden" name="validate" value="<!--{$validate}-->" />
					<dl class="formList">
						<dd>
							<div class="colum_left">
								会员名：
							</div>
							<div class="colum_right paddingTop5">
								<!--{$user->username}-->
							</div>
						</dd>
						<dd>
							<div class="colum_left">
								当前E-mail地址：
							</div>
							<div class="colum_right paddingTop5">
								<span class="fOrange"><!--{$user->email}--></span>
							</div>
						</dd>
						<dd>
							<div class="colum_left">
								请输入您的密码：
							</div>
							<div class="colum_right">
								<div class="inputbox">
									<span class="input">
										<cite><input id="password" name="password" type="password" alt="密码:errArea{passwordtip}" value="" /></cite>
									</span>
								</div>
							</div>
						</dd>
						<dd>
							<div class="colum_left">
								新E-mail地址：
							</div>
							<div class="colum_right">
								<div class="inputbox">
									<span class="input">
										<cite><input id="email" name="email" type="text" maxlength="37" alt="邮箱名:errArea{emailtip}" value="<!--{$email}-->" /></cite>
									</span>
								</div>
								<span id="emailtip" class="tip"></span>
								<div class="inputtip fGray">登录邮箱是您在<!--{$SITE_NAME}-->的重要凭证，请使用常用及安全的电，当密码遗失时凭此领取</div>
							</div>
						</dd>
					</dl>
					<dl class="formList">
						<dd>
							<div class="colum_left"></div>
							<div class="colum_right">
								<input type="submit" class="btn_submit" value="提交" />
							</div>
						</dd>
					</dl>
				</form>
			</div>
			<b class="fillet5"></b><b class="fillet6"></b><b class="fillet7"></b><b class="fillet8"></b>
		</div>
	</div>
</div>
<!--{include file='footer.tpl'}-->
</body>
</html>